-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Update databases examples #8374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update databases examples #8374
Conversation
Pre-merge checks❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
databases/cockroachdb/bun.lockis excluded by!**/*.lockdatabases/postgresql-supabase/bun.lockis excluded by!**/*.lockdatabases/prisma-postgres/bun.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
databases/cockroachdb/package.json(1 hunks)databases/cockroachdb/prisma/schema.prisma(2 hunks)databases/cockroachdb/src/script.ts(1 hunks)databases/cockroachdb/tests/prisma.test.ts(1 hunks)databases/postgresql-supabase/package.json(1 hunks)databases/postgresql-supabase/prisma.config.ts(1 hunks)databases/postgresql-supabase/prisma/schema.prisma(1 hunks)databases/postgresql-supabase/prisma/seed.ts(1 hunks)databases/postgresql-supabase/script.ts(1 hunks)databases/prisma-postgres/package.json(1 hunks)databases/prisma-postgres/prisma.config.ts(1 hunks)databases/prisma-postgres/prisma/schema.prisma(2 hunks)databases/prisma-postgres/src/caching.ts(1 hunks)databases/prisma-postgres/src/queries.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/fastify-graphql-sdl-first/src/context.ts:1-1
Timestamp: 2025-10-27T13:18:46.546Z
Learning: The prisma/prisma-examples repository is a monorepo containing many independent example projects. When reviewing PRs in this repository, focus only on the files actually changed by the author in that specific PR, not on other example projects or infrastructure that wasn't modified.
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/betterauth-astro/src/pages/sign-up/index.astro:20-36
Timestamp: 2025-10-24T17:50:48.569Z
Learning: Do not suggest code changes or improvements to code in Prisma example repositories (prisma/prisma-examples). These examples are carefully set up and intentionally aligned with external documentation and information.
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/fastify-graphql/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:29.130Z
Learning: In Prisma v6.15 and later, `provider = "prisma-client"` is a valid generator configuration value when combined with `engineType = "client"`. This configuration generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead, and is different from the traditional `provider = "prisma-client-js"` configuration.
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-subscriptions/prisma/schema.prisma:1-5
Timestamp: 2025-10-15T13:56:01.807Z
Learning: In Prisma v6.15 and later, `engineType = "client"` is a valid generator configuration value that generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead (e.g., prisma/adapter-pg). This is useful for edge and serverless deployments.
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/fastify-graphql-sdl-first/src/context.ts:1-1
Timestamp: 2025-10-27T13:18:46.546Z
Learning: In the prisma/prisma-examples repository, generated Prisma client files (typically at paths like `prisma/generated/client`) are intentionally not committed to the repository. These files are generated at build/test time. Do not flag missing generated client artifacts as issues in reviews.
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.
📚 Learning: 2025-08-22T12:12:24.602Z
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.
Applied to files:
databases/postgresql-supabase/prisma/seed.tsdatabases/cockroachdb/src/script.tsdatabases/postgresql-supabase/prisma.config.tsdatabases/postgresql-supabase/package.jsondatabases/cockroachdb/package.jsondatabases/cockroachdb/prisma/schema.prismadatabases/prisma-postgres/prisma.config.tsdatabases/cockroachdb/tests/prisma.test.tsdatabases/prisma-postgres/src/queries.tsdatabases/postgresql-supabase/prisma/schema.prismadatabases/postgresql-supabase/script.tsdatabases/prisma-postgres/prisma/schema.prismadatabases/prisma-postgres/package.json
📚 Learning: 2025-10-15T13:58:29.130Z
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/fastify-graphql/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:29.130Z
Learning: In Prisma v6.15 and later, `provider = "prisma-client"` is a valid generator configuration value when combined with `engineType = "client"`. This configuration generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead, and is different from the traditional `provider = "prisma-client-js"` configuration.
Applied to files:
databases/postgresql-supabase/prisma/seed.tsdatabases/cockroachdb/src/script.tsdatabases/prisma-postgres/src/caching.tsdatabases/cockroachdb/prisma/schema.prismadatabases/cockroachdb/tests/prisma.test.tsdatabases/prisma-postgres/src/queries.tsdatabases/postgresql-supabase/prisma/schema.prismadatabases/postgresql-supabase/script.tsdatabases/prisma-postgres/prisma/schema.prisma
📚 Learning: 2025-10-15T13:58:59.096Z
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.
Applied to files:
databases/postgresql-supabase/prisma/seed.tsdatabases/cockroachdb/src/script.tsdatabases/prisma-postgres/src/caching.tsdatabases/cockroachdb/prisma/schema.prismadatabases/cockroachdb/tests/prisma.test.tsdatabases/prisma-postgres/src/queries.tsdatabases/postgresql-supabase/prisma/schema.prismadatabases/postgresql-supabase/script.tsdatabases/prisma-postgres/prisma/schema.prismadatabases/prisma-postgres/package.json
📚 Learning: 2025-10-15T13:56:01.807Z
Learnt from: AmanVarshney01
Repo: prisma/prisma-examples PR: 8327
File: orm/graphql-subscriptions/prisma/schema.prisma:1-5
Timestamp: 2025-10-15T13:56:01.807Z
Learning: In Prisma v6.15 and later, `engineType = "client"` is a valid generator configuration value that generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead (e.g., prisma/adapter-pg). This is useful for edge and serverless deployments.
Applied to files:
databases/postgresql-supabase/prisma/seed.tsdatabases/cockroachdb/src/script.tsdatabases/prisma-postgres/src/caching.tsdatabases/cockroachdb/prisma/schema.prismadatabases/cockroachdb/tests/prisma.test.tsdatabases/prisma-postgres/src/queries.tsdatabases/postgresql-supabase/prisma/schema.prismadatabases/postgresql-supabase/script.tsdatabases/prisma-postgres/prisma/schema.prisma
📚 Learning: 2025-10-27T13:18:46.546Z
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/fastify-graphql-sdl-first/src/context.ts:1-1
Timestamp: 2025-10-27T13:18:46.546Z
Learning: In the prisma/prisma-examples repository, generated Prisma client files (typically at paths like `prisma/generated/client`) are intentionally not committed to the repository. These files are generated at build/test time. Do not flag missing generated client artifacts as issues in reviews.
Applied to files:
databases/postgresql-supabase/prisma/seed.tsdatabases/cockroachdb/src/script.tsdatabases/prisma-postgres/src/caching.tsdatabases/cockroachdb/prisma/schema.prismadatabases/cockroachdb/tests/prisma.test.tsdatabases/prisma-postgres/src/queries.tsdatabases/postgresql-supabase/prisma/schema.prismadatabases/postgresql-supabase/script.tsdatabases/prisma-postgres/prisma/schema.prisma
📚 Learning: 2025-08-22T12:12:43.161Z
Learnt from: FGoessler
Repo: prisma/prisma-examples PR: 8260
File: generator-prisma-client/nextjs-starter-turbopack/components/quotes.tsx:1-1
Timestamp: 2025-08-22T12:12:43.161Z
Learning: In Next.js applications using Prisma, the connection() function from 'next/server' serves a different purpose than 'export const dynamic = force-dynamic'. The connection() function ensures proper database connection context and request isolation, while dynamic = 'force-dynamic' only controls rendering strategy. Both should be used together and are not redundant.
Applied to files:
databases/postgresql-supabase/prisma/seed.tsdatabases/cockroachdb/src/script.tsdatabases/prisma-postgres/src/caching.tsdatabases/cockroachdb/tests/prisma.test.tsdatabases/prisma-postgres/src/queries.tsdatabases/postgresql-supabase/script.ts
📚 Learning: 2025-10-27T13:18:46.546Z
Learnt from: aidankmcalister
Repo: prisma/prisma-examples PR: 8334
File: orm/fastify-graphql-sdl-first/src/context.ts:1-1
Timestamp: 2025-10-27T13:18:46.546Z
Learning: The prisma/prisma-examples repository is a monorepo containing many independent example projects. When reviewing PRs in this repository, focus only on the files actually changed by the author in that specific PR, not on other example projects or infrastructure that wasn't modified.
Applied to files:
databases/prisma-postgres/package.json
🧬 Code graph analysis (6)
databases/postgresql-supabase/prisma/seed.ts (2)
orm/prisma-mocking-javascript/client.js (1)
adapter(4-4)databases/cockroachdb/tests/prisma.test.ts (1)
prisma(8-10)
databases/cockroachdb/src/script.ts (2)
orm/prisma-mocking-javascript/client.js (1)
adapter(4-4)databases/cockroachdb/tests/prisma.test.ts (1)
prisma(8-10)
databases/prisma-postgres/src/caching.ts (1)
databases/cockroachdb/tests/prisma.test.ts (1)
prisma(8-10)
databases/cockroachdb/tests/prisma.test.ts (1)
orm/prisma-mocking-javascript/client.js (1)
adapter(4-4)
databases/prisma-postgres/src/queries.ts (1)
databases/cockroachdb/tests/prisma.test.ts (1)
prisma(8-10)
databases/postgresql-supabase/script.ts (2)
orm/prisma-mocking-javascript/client.js (1)
adapter(4-4)databases/cockroachdb/tests/prisma.test.ts (1)
prisma(8-10)
🪛 Biome (2.1.2)
databases/cockroachdb/tests/prisma.test.ts
[error] 7-10: Do not export from a test file.
(lint/suspicious/noExportsInTest)
🔇 Additional comments (13)
databases/prisma-postgres/prisma.config.ts (1)
1-12: LGTM! Configuration follows Prisma v6 patterns.The configuration correctly uses
defineConfigwith dotenv integration and environment-based datasource URL, aligning with the new Prisma configuration approach.databases/cockroachdb/package.json (1)
9-26: LGTM! Dependencies aligned with adapter-based client.The package updates correctly introduce tsx, @prisma/adapter-pg, and align Prisma package versions to support the new generated client approach with adapters.
databases/prisma-postgres/package.json (1)
5-16: LGTM! Package updates support the new Prisma Accelerate configuration.The migration to tsx and removal of @prisma/extension-accelerate align with the new pattern of configuring Accelerate via PrismaClient options instead of extensions.
databases/prisma-postgres/prisma/schema.prisma (1)
2-4: LGTM! Generator configuration follows Prisma v6+ patterns.The migration to
provider = "prisma-client"with explicit output path andengineType = "client"is the correct approach for the new ESM-ready client that will become the default in Prisma v7.Based on learnings
databases/prisma-postgres/src/queries.ts (1)
1-6: LGTM! Updated to use generated client with Accelerate configuration.The changes correctly migrate to the generated Prisma client and configure Accelerate via the
accelerateUrloption, replacing the extension-based approach.databases/postgresql-supabase/package.json (1)
6-19: LGTM! Package updates support adapter-based client configuration.The migration to tsx and addition of @prisma/adapter-pg correctly enable the new adapter-based approach for PostgreSQL/Supabase connections.
databases/postgresql-supabase/prisma/seed.ts (1)
1-9: LGTM! Adapter initialization follows the correct pattern.The changes properly migrate to the generated Prisma client with PrismaPg adapter configuration, using the connection string from environment variables.
databases/prisma-postgres/src/caching.ts (1)
1-5: Addimport 'dotenv/config'at line 2 of caching.ts.The code uses
process.env.DATABASE_URLbut is missing the dotenv import. Since the script runs directly viatsx ./src/caching.ts(as defined in package.json), it needs to explicitly load environment variables. The queries.ts file has this import on line 2—caching.ts should match that pattern.⛔ Skipped due to learnings
Learnt from: FGoessler Repo: prisma/prisma-examples PR: 8260 File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13 Timestamp: 2025-08-22T12:12:24.602Z Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.Learnt from: aidankmcalister Repo: prisma/prisma-examples PR: 8334 File: orm/fastify-graphql-sdl-first/src/context.ts:1-1 Timestamp: 2025-10-27T13:18:46.546Z Learning: In the prisma/prisma-examples repository, generated Prisma client files (typically at paths like `prisma/generated/client`) are intentionally not committed to the repository. These files are generated at build/test time. Do not flag missing generated client artifacts as issues in reviews.Learnt from: AmanVarshney01 Repo: prisma/prisma-examples PR: 8327 File: orm/graphql-auth/prisma/schema.prisma:2-4 Timestamp: 2025-10-15T13:58:59.096Z Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.Learnt from: AmanVarshney01 Repo: prisma/prisma-examples PR: 8327 File: orm/fastify-graphql/prisma/schema.prisma:2-4 Timestamp: 2025-10-15T13:58:29.130Z Learning: In Prisma v6.15 and later, `provider = "prisma-client"` is a valid generator configuration value when combined with `engineType = "client"`. This configuration generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead, and is different from the traditional `provider = "prisma-client-js"` configuration.Learnt from: AmanVarshney01 Repo: prisma/prisma-examples PR: 8327 File: orm/graphql-subscriptions/prisma/schema.prisma:1-5 Timestamp: 2025-10-15T13:56:01.807Z Learning: In Prisma v6.15 and later, `engineType = "client"` is a valid generator configuration value that generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead (e.g., prisma/adapter-pg). This is useful for edge and serverless deployments.Learnt from: FGoessler Repo: prisma/prisma-examples PR: 8260 File: generator-prisma-client/nextjs-starter-turbopack/components/quotes.tsx:1-1 Timestamp: 2025-08-22T12:12:43.161Z Learning: In Next.js applications using Prisma, the connection() function from 'next/server' serves a different purpose than 'export const dynamic = force-dynamic'. The connection() function ensures proper database connection context and request isolation, while dynamic = 'force-dynamic' only controls rendering strategy. Both should be used together and are not redundant.databases/cockroachdb/src/script.ts (1)
1-11: LGTM! Clean migration to adapter-based client.The changes correctly implement the Prisma v6 adapter-based pattern: importing from the generated client path, setting up the PrismaPg adapter with the connection string, and initializing PrismaClient with the adapter. This aligns with the schema's new generator configuration.
Based on learnings
databases/cockroachdb/prisma/schema.prisma (1)
1-5: LGTM! Proper migration to the new Prisma client generator.The generator configuration correctly adopts the
"prisma-client"provider withengineType = "client"and explicit output path. This modern approach generates an ESM-ready client without Rust binaries, relying on JavaScript driver adapters (PrismaPg), and is well-suited for edge deployments.Based on learnings
databases/postgresql-supabase/prisma.config.ts (1)
1-12: LGTM! Well-structured Prisma configuration.The configuration file correctly uses
defineConfigfor type-safe setup, loads environment variables withdotenv/config, and properly specifies the schema, migrations, and datasource paths. This aligns with the modern Prisma configuration approach.databases/postgresql-supabase/script.ts (1)
1-9: LGTM! Consistent adapter-based migration.The changes properly implement the adapter-based pattern: importing from the generated client, setting up the PrismaPg adapter, and initializing PrismaClient with the adapter. The pattern is consistent with the CockroachDB example and aligns with the new generator configuration in the schema.
Based on learnings
databases/postgresql-supabase/prisma/schema.prisma (1)
4-8: LGTM! Proper generator configuration for adapter-based client.The generator configuration correctly migrates to
"prisma-client"provider withengineType = "client"and explicit output path. This setup generates an ESM-ready client that relies on JavaScript driver adapters (PrismaPg), matching the pattern used in the CockroachDB example and aligning with Prisma v6+ best practices.Based on learnings
mhartington
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the url from the prisma schema as per the latest pre-release.
* Update all accelerate example (#8373) * Update misc examples (#8372) * Update misc examples with prisma.config.ts and adapter (#8362) * Update HTTP web server examples (#8354) * update all nextjs examples in `generator-prisma-client/` (#8342) * Update fullstack examples with prisma config and pg adapter (#8344) Co-authored-by: Nurul Sundarani <sundarani@prisma.io> * Update Nuxt & React Router examples (#8368) * Update optimize examples (#8375) * Update Bun & Deno examples (#8343) * Update GraphQL examples with prisma.config.ts and pg adapter (#8345) * update cockroachdb, postgresql-supabase, prisma-postgres examples (#8374) * remove engine classic and url from schema.prisma * update deployment * update readme * delete all lock files and update prisma version to 7.0.0 * update remaining examples * update d1 example * fix * update turso example * fix * update nuxt example * fix nextjs example * update all deps to 7.0.0 * fix --------- Co-authored-by: Nurul Sundarani <sundarani@prisma.io>
Summary by CodeRabbit